package com.zbf.user.web;

import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisKeyValueTemplate;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: LCG
 * 作者: LCG
 * 日期: 2020/9/7  23:54
 * 描述:
 */
@RestController
public class UserController {


    @Autowired
    private RedisTemplate<String,String> redisTemplate;

    @RequestMapping("yantelcode")
    public String yantelcode(String tel,String code){

        String s = redisTemplate.opsForValue().get(code);
        System.out.println("redis中的code:"+s);
        System.out.println("前端中的code:"+code);
        if (s.equals(code)){
            return  "ok";
        }


        return "fail";
    }

}
